
<#include "header.ftl">
 <link rel="stylesheet" href="${Domain}common/ufinder/themes/css/ufinder.css"/>
  <!-- 内容区域 -->
<div class="tpl-content-wrapper">
 <div class="container-fluid am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <ol class="am-breadcrumb">
						  <li><a href="${Domain}my" class="am-icon-home">首页</a></li>
						  <li ><a href="${Domain}my/patient/list">患者</a></li>
						  <li class="am-active">${patient.name}附件</li>						  
						</ol>
                    </div>
                  	<#include "../common/return.ftl">
                </div>
  </div>
       <div class="row-content am-cf">
                <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                 <div class="widget-title  am-fl">
                                   	患者:${patient.name}
                                                                                           性别：<#switch patient.gender>
										           <#case 0> 未知 <#break>
										           <#case 1>男<#break>
										           <#case 2>女<#break>
										           <#default>未知
										 </#switch>
									 年龄：${patient.Age()}
									 身份证：${patient.SimpleNo()}
								</div>
								

                            </div>
							<div class="widget-body  am-fr">


					<div class="am-tabs" data-am-tabs="{noSwipe: 1}" id="patient-${patient.id}">
					  <ul class="am-tabs-nav am-nav am-nav-tabs">
					    <li class="am-active"><a href="javascript: void(0)">信息</a></li>
					    <li><a href="javascript: void(0)">治疗</a></li>
					    <li><a href="javascript: void(0)">随访</a></li>
					    <li><a href="javascript: void(0)">附件</a></li>
					    <li><a href="javascript: void(0)">联系人</a></li>
					     <li><a href="javascript: void(0)">评论</a></li>
					  </ul>
					
					  <div class="am-tabs-bd">
					  
					  <!--  档案 -->
					    <div class="am-tab-panel am-active">
					     
					     <div class="am-scrollable-horizontal">
                                
                                    <table width="100%" class="<#include "../common/table-class.ftl">"  >
                                        <thead>
                                            <tr>
                                                <th width="80px">编号</th>
                                                <th>名称</th>
                                                <th>状态</th> 
                                                <th>进度</th>  
                                                <th>打开次数</th>  
                                                <th>用时</th>                                                      
                                              <th>创建时间</th>
                                              <th  width="120px">操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <#list heaths as item>
                                            <tr >
                                                 <td>${item.id}</td>
                                                <td>${item.name!}</td> 
                                                <td><#switch item.state>
										           <#case 0>创建 <#break>
										           <#case 1>进行<#break>
										           <#case 2>完成<#break>
										           <#case -1>失效<#break>
										           <#default>未知
										        	</#switch> </td>
										        	 
                                                  <td>
                                                  <#if item.total!=0>
                                                  ${item.speed*100/item.total}%(${item.speed}/${item.total})
                                                  <#else>
													-
												</#if>
												</td>                                        
                                                <td>${item.opencount}</td>
                                                <td>${item.usetime/1000}秒</td>
                                       
                                                <td>${item.time}</td>
                                                <td>
                                            
                                                    <div class="tpl-table-black-operation">
                                                       
                                                       <#if item.state==0||item.state==1>
                                                       <a href="${Domain}my/access/ask/${item.id}" target="_blank">
                                                            <i class="am-icon-question"></i> 访问
                                                        </a>
                                                        </#if>
                                                  	<a href="${Domain}my/access/show/${item.id}" target="_blank"  class="tpl-table-black-operation-del">
                                                            <i class="am-icon-file-o"></i> 详情
                                                        </a>
                                                 <a href="${Domain}my/access/update/${item.id}" target="_blank">
                                                            <i class="am-icon-pencil"></i> 更新
                                                        </a>
                                               
  													</div>
                                                </td>
                                            </tr>
                                            </#list>
                                        </tbody>
                                    </table>
                                    
                                     <table width="100%" class="am-table"  >
                                	<tbody>
                                	<tr>
                                                <th width="120px">姓名</th>
                                                <td>${patient.name}</td>
                                      </tr> 
                                      <tr>
                                                <th>性别</th>
                                                <td><#switch patient.gender>
										           <#case 0> 未知 <#break>
										           <#case 1>男<#break>
										           <#case 2>女<#break>
										           <#default>未知
										 </#switch></td>
                                      </tr> 
                                       <tr>
                                                <th> 年龄</th>
                                                <td>${patient.Age()}</td>
                                      </tr> 
                                       <tr>
                                                <th> 身份证</th>
                                                <td>${patient.SimpleNo()}</td>
                                      </tr> 
                                      <#list heathmaps?keys as key>
                                      <#if heathmaps[key]?size gt 0>
                                      <tr>
                                           <td> ${heathmaps[key][0].name}</td>
                                           <td><#list heathmaps[key] as item>${item.description} </#list></td>
                                      </tr> 
                                      </#if>
									　
									  </#list>       
                                	</tbody>
                                	</table>
                                    
                                    </div>
					     
					     
					     
					    </div>
					    
					    <!-- 治疗 -->
					    <div class="am-tab-panel">
					     
					      <div class="am-scrollable-horizontal">
                                
                                     <table width="100%" class="<#include "../common/table-class.ftl">"  >
                                        <thead>
                                            <tr>
                                                <th>疾病</th>
                                                <th>确诊时间</th>
                                                <th>开始治疗</th>
                                                <th>结束时间 </th>
                                                <th>随访周期</th> 
                                                 <th>最近随访时间</th>                                            
                                               <th>下次近随访时间</th> 
                                               <th>状态</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <#list cures as item>
                                            <tr >
                                                <td>${item.dname}</td>
                                                <td>${item.tdate}</td>
												<td>${item.startdate}</td>
                                                <td>${item.enddate}</td>
                                                <td>${item.cycle}</td>
                                                <td>${item.lfdate}</td>
                                                <td>${item.nfdate}</td>
                                                <td><#switch item.type>
										           <#case 0> <span class="am-text-danger">治疗中</span> <#break>
										           <#case 1><span class="am-text-success">治疗完成</span><#break>
										           <#case -1><span class="am-text-default">失效</span><#break>
										           <#default><span class="am-text-danger">未知</span>
										        	</#switch></td>
                                                <td>${item.time?string("yyyy-MM-dd")}</td>
                                                <td>
                                                
                                                    <div class="tpl-table-black-operation">
                                                    	
                                                       
                                                       
                                                    </div>
                                                  
                                                </td>
                                            </tr>
                                            </#list>
                                        </tbody>
                                    </table>
                                    </div>
					     
					     
					    </div>
					    <!-- 随访  -->
					    <div class="am-tab-panel">
					    
					      <div class="am-scrollable-horizontal">
                                
                                    <table width="100%" class="<#include "../common/table-class.ftl">"  >
                                        <thead>
                                            <tr>
                                                <th width="80px">编号</th>
                                                <th>名称</th>
                                                <th>状态</th> 
                                                <th>进度</th>  
                                                <th>打开次数</th>  
                                                <th>用时</th>                                                      
                                              <th>创建时间</th>
                                              <th width="150px">操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <#list accesses as item>
                                            <tr >
                                                 <td>${item.id}</td>
                                                <td>${item.name!}</td> 
                                                <td><#switch item.state>
										           <#case 0>创建 <#break>
										           <#case 1>进行<#break>
										           <#case 2>完成<#break>
										           <#case -1>失效<#break>
										           <#default>未知
										        	</#switch> </td>
										        	 
                                                  <td>
                                                  <#if item.total!=0>
                                                  ${item.speed*100/item.total}%(${item.speed}/${item.total})
                                                  <#else>
													-
												</#if>
												</td>                                        
                                                <td>${item.opencount}</td>
                                                <td>${item.usetime/1000}秒</td>
                                       
                                                <td>${item.time}</td>
                                                <td>
                                            
                                                    <div class="tpl-table-black-operation">
                                                       
                                                       <a href="${Domain}my/access/ask/${item.id}" target="_blank">
                                                            <i class="am-icon-pencil"></i> 访问
                                                        </a>
                                                  	<a href="${Domain}my/access/show/${item.id}" target="_blank">
                                                            <i class="am-icon-pencil"></i> 详情
                                                        </a>
                                                 <a href="${Domain}my/access/update/${item.id}" target="_blank">
                                                            <i class="am-icon-pencil"></i> 更新
                                                        </a>
                                               
  													</div>
                                                </td>
                                            </tr>
                                            </#list>
                                        </tbody>
                                    </table>
                                    </div>
                                    
					    </div>
					    
					    <!-- 附件 -->
					    <div class="am-tab-panel">
					    
					        <div id="patient-annex"></div>
		
							<script>								
							var serverUrl=	'${Domain}api/upload/ufinder/${patient.id}';	
							var domain='${Domain}';	
							var realUrl='${Domain}/annex/${user.main}/${patient.id}'				
							$(function () {
													    
									 window.uf = UF.getUFinder('patient-annex');
							});
							</script>
							<script src="${Domain}common/ufinder/ufinder.show.config.js"></script>
							 <script src="${Domain}common/ufinder/ufinder.js"></script>
							<script src="${Domain}common/ufinder/lang/zh-cn/zh-cn.js"></script>	
														
					    </div>
					    
					    <!-- 联系人 -->
					     <div class="am-tab-panel am-active">
					      <div class="am-scrollable-horizontal">                              
                                    <table width="100%" class="<#include "../common/table-class.ftl">"  >
                                        <thead>
                                            <tr>
                                                <th width="80px">编号</th>
                                                <th>名称</th>
                                                <th>电话</th>
                                                <th>关系</th>
                                                <th>有效</th>
                                                <th>默认</th>
                                              <th width="120px">操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <#list linkmains as item>
                                            <tr >
                                                 <td>${item.id}</td>
                                                <td>${item.name}</td> 
                                                <td>${item.tel}</td>  
                                                <td>
                                                <#switch item.relation>
										           <#case 0> <span class="am-text-danger">自己</span> <#break>
										           <#case 1> <span class="am-btn-primary">夫妻</span><#break>
										           <#case 2> <span class="am-btn-warning">子女</span><#break>
										           <#case 3> <span class="am-btn-secondary">父母</span><#break>
										           <#case 4> <span class="am-btn-success">亲人</span><#break>
										           <#case 5> <span class="am-btn-default">朋友</span><#break>
										           <#default>未知
										        	</#switch>
												</td>  
                                                <td>
                                                 <#switch item.isuse>
										           <#case 1> <span class="am-text-success">是</span> <#break>
										           <#case 0> <span class="am-text-danger">否</span><#break>
										           <#default>未知
										        </#switch>
												</td>  
                                                <td>
                                                <#switch item.isdefault>
										           <#case 1> <span class="am-text-danger">是</span> <#break>
										           <#case 0> <span class="am-text-success">否</span><#break>
										           <#default>未知
										        </#switch>
												</td>                                         
                                                <td>
                                              
                                                    <div class="tpl-table-black-operation">
                                                        <a href="${Domain}my/patient/linkmanupdate/${item.id}?url=${url}">
                                                            <i class="am-icon-pencil"></i> 编辑
                                                        </a>
                                                    </div>
                                                  
                                                </td>
                                            </tr>
                                            </#list>
                                        </tbody>
                                    </table>
                                    </div>
					    </div>
					    
					    <!-- 评论 -->
					     <div class="am-tab-panel am-active">
					      <div class="">                              
                                <!--评论框  -->
							<section class="am-g ">
							 	 
							<div class="am-panel-bd">
							<div class="am-comment">
							<a href="#">
							<img src="${Domain}${user.Avatar()}" alt="" class="am-comment-avatar"></a>
							<div class="am-comment-main">
							<form method="post" class="am-form" action="${Domain}api/memo/add" id="msgs_add">
							<input type="hidden" id="oid" name="oid" value="${patient.id}">
							<input type="hidden" id="otype" name="otype" value="patient">
							 <div class="am-form-group">   
							      <textarea class="" id="msgs" rows="3"  name="msgs"   placeholder="有什么相关建议？你来说说吧！"></textarea>   
							    </div>
							   <footer class="am-comment-footer " >
							  <button type="submit" class="am-btn am-btn-success am-radius am-btn-sm  btn-loading-example"    > 发 送 </button>
							    
							  </footer>
							</form>							
					<script type="text/javascript">
					    var loading; 
					   $('#msgs_add').ajaxForm({
						    beforeSubmit: function(a,f,o) {
						        loading=weui.loading('数据加载中...');
						    },
						    success: function(json) {	    	
						    	if(json.status)
						    	{
						    	  	if(loading)loading.hide();
						    		weui.toast("添加成功！"); 	  			
						    		var html=' <article class="am-comment" id="memo_'+json.msg+'">'+							  
									  ' <img src="${Domain}${freemarker.avatar(user.avatar)}" alt="" class="am-comment-avatar" height="48" width="48">'+						 
									  ' <div class="am-comment-main">'+
									  ' <div class="am-comment-hd"><div class="am-comment-meta">'+
									  ' ${user.name}  </div>  '+
									  '<div class="am-comment-actions">	'+					
							  		  '<a href="javascript:deleteItem('+json.msg+')" title="删除"><i class="am-icon-close"></i></a>	'+						
							  		 '</div>'+
									  '</div>	'+					  
									  ' <div class="am-comment-bd">'+
									  ' <p>'+$("#msgs").val()+'</p>	'+						 
									  ' </div>'+
									  ' </article>';
									  $("#tngou-list").prepend(html);
						    		  		
						    	}else
						    	{	
						    		if(loading)loading.hide();
						    	    weui.alert(json.msg);  		 
						    	}
						    }
						});
						</script>
							
							
							</div>
							</div>
							</div>
							</section>
                             
                             
                             <div class="am-comments-list" id="tngou-list">
						
						<#list memos as item>
							  <article class="am-comment" id="memo_${item.id}">							  
							  <img src="${Domain}${freemarker.avatar(item.avatar)}" alt="" class="am-comment-avatar" height="48" width="48">						 
							  <div class="am-comment-main">
							  <div class="am-comment-hd"><div class="am-comment-meta">
							  ${item.name} 发送于 <time datetime="${item.time}" title="${item.time}">${freemarker.prettytime(item.time)}</time>
							  </div>
							  <div class="am-comment-actions">
							  <#if user.id==item.uid>
							  <a href="javascript:deleteItem(${item.id})" title="删除"><i class="am-icon-close"></i></a>
							  </#if>
							  </div>
							  </div>						  
							  <div class="am-comment-bd">
							  <p>${item.msgs}</p>							 
							  </div>
							  </article>
							</#list>
                                
                                    
                           </div>
					     </div>
					    
					    
					    
					  </div>
					</div>

     
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        
 </div>   <script type="text/javascript">
 var loading;
 function deleteItem(id)
 {
 	weui.confirm('是否删除该数据?', 
 	function(){ 
 	   loading =weui.loading('数据删除中...');
 		$.getJSON("${Domain}api/memo/delete", { id: id }, function(json){
		  if(json.status)
		  {
		     if(loading) loading.hide();
	    	 weui.toast(json.msg);
	    	 $("#memo_"+id).hide();
	    	// location.href="";	
		  }else
	    	{	
	    		if(loading) loading.hide();
	    	    weui.alert(json.msg);  		 
	    	}
		});
 	  },
    function(){ console.log('no') });
 }
 </script>   
 
    
<#include "footer.ftl">